const data = [
  {title: {text: "设置"},icon: {icon: $icon("002", $color("#303643"), $size(36, 36))},url: "App-Prefs://"},
  {title: {text: "WIFI"},icon: {icon: $icon("005", $color("#303643"), $size(36, 36))},url: "App-prefs:WIFI"},
  {title: {text: "Bluetooth"},icon: {icon: $icon("006", $color("#303643"), $size(36, 36))},url: "App-prefs:Bluetooth"},
  {title: {text: "开灯"},icon: {icon: $icon("093", $color("#303643"), $size(36, 36))},url: "shortcuts://run-shortcut?name=%E6%B8%A9%E9%A6%A8"},
  {title: {text: "关灯"},icon: {icon: $icon("092", $color("#303643"), $size(36, 36))},url: "shortcuts://run-shortcut?name=%E5%85%B3%E7%81%AF"},
  {title: {text: "门头灯关闭"},icon: {src: "assets/门头灯.png"},url:"shortcuts://run-shortcut?name=%E9%97%A8%E5%A4%B4%E9%97%A8%E5%85%B3"},
  {title: {text: "收钱"},icon: {src: "assets/收钱.png"},url: "mobilenotes://"},
  {title: {text: "淘宝"},icon: {src: "assets/taobao.png"},url: "taobao://"},
  {title: {text: "闲鱼"},icon: {src: "assets/xianyu.png"},url: "fleamarket://"},
  {title: {text: "hilink"},icon: {src: "assets/hilink.png"},url: "hilink://"},
  {title: {text: "mihome"},icon: {src: "assets/mihome.png"},url: "mihome://"},
  {title: {text: "雪球"},icon: {src: "assets/xueqiu.png"},url: "xueqiu://"},
  {title: {text: "amihexinpro"},icon: {src: "assets/amihexinpro.png"},url: "amihexinpro://"},
  {title: {text: "jdmobile"},icon: {src: "assets/jdmobile.png"},url: "openapp.jdmobile://"},
  {title: {text: "applestore"},icon: {src: "assets/applestore.png"},url: "itms-apps://search.itunes.apple.com/WebObjects/MZSearch.woa/wa/search?media=software"},
  {title: {text: "shareddocuments"}, icon: {src: "assets/shareddocuments.png"}, url: "shareddocuments://"},
  {title: {text: "shortcuts"}, icon: {src: "assets/shortcuts.png"}, url: "shortcuts://"},
  {title: {text: "hikProtocol"}, icon: {src: "assets/hikProtocol.png"}, url: "hikProtocol://"},
  {title: {text: "xiaoming"}, icon: {src: "assets/xiaoming.png"}, url: "xiaoming://"},
  {title: {text: "fpuser"}, icon: {src: "assets/fpuser.png"}, url: "fpuser://"},
  {title: {text: "camscanner"}, icon: {src: "assets/camscanner.png"}, url: "camscanner://"},
  {title: {text: "cmbmobilebank"}, icon: {src: "assets/cmbmobilebank.png"}, url: "cmbmobilebank://"},
  {title: {text: "Alook"}, icon: {src: "assets/Alook.png"}, url: "Alook://Search"},
  {title: {text: "duokan"}, icon: {src: "assets/duokan.png"}, url: "duokan-reader://"},
  {title: {text: "weixin"}, icon: {src: "assets/weixin.png"}, url: "weixin://"},
  {title: {text: "alipay"}, icon: {src: "assets/alipay.png"}, url: "alipay://"},
  {title: {text: "高德"}, icon: {src: "assets/gaode.png"}, url: "wb884965267://"},
  {title: {text: "iting"}, icon: {src: "assets/iting.png"}, url: "iting://"},
  {title: {text: "分享到讯飞"}, icon: {src: "assets/讯飞有声.png"}, url: "shortcuts://run-shortcut?name=%E6%89%93%E5%BC%80%E8%BF%85%E9%A3%9E%E6%9C%89%E5%A3%B0"},
  {title: {text: "抖音"},icon: {src: "assets/抖音.png"},url: "awemesso://"},
  {title: {text: "fe"},icon: {src: "assets/fe.png"},url: "fepro://"},
  {title: {text: "baiduyun"},icon: {src: "assets/baiduyun.png"},url: "baiduyun://"},
  {title: {text: "百度云青春版"},icon: {src: "assets/baiduyunqc.png"},url: "shortcuts://run-shortcut?name=%E7%99%BE%E5%BA%A6%E4%BA%91%E9%9D%92%E6%98%A5%E7%89%88"},
  {title: {text: "pythonista"},icon: {src: "assets/pythonista.png"},url: "pythonista://"}
];

$ui.render({
  props: {title: "Launcher"},
  views: [
    {
      type: "matrix",
      props: {
        columns: 7,
        itemHeight: 35,
        spacing: 10,
        template: [
          { type: "view", props: {id: "bgcolor", radius: 17 }, layout: $layout.fill },
          {
            type: "label",
            props: { id: "title", textColor: $color("white"), bgcolor: $color("clear"), hidden: true },
            layout(make, view) { make.bottom.inset(0); make.centerX.equalTo(view.super); make.height.equalTo(27); }
          },
          {
            type: "image",
            props: {id: "icon", bgcolor: $color("clear"), smoothRadius: 6},
            layout(make, view) { make.top.inset(3); make.centerX.equalTo(view.super); make.size.equalTo(35); }
          }
        ],
        data: data
      },
      layout: $layout.fill,
      events: { didSelect(sender, indexPath, data) { $app.openURL(data.url); } }
    }
  ]
});
